package com.hnas.ecard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hnas.ecard.orm.CardTrail;
import com.hnas.ecard.service.CardTrailService;
import com.hnas.ecard.service.CheckSendRecordTaskService;

@Component("checkSendRecordTaskService")
public class CheckSendRecordTaskServiceImpl implements CheckSendRecordTaskService{

	@Autowired
	private CardTrailService cardTrailService;
	
	
	@Override
	public void checkSendRecord() {
		//找出当前已经超过时间的卡和赠送记录，做回退操作
		List<CardTrail> list = this.cardTrailService.listOverTime();
		if(list == null || list.size() <=0) return;
		for(CardTrail t : list) {
			this.cardTrailService.autoReturnECard(t);
		}
	}

}
